// -*-c++-*- Copyright (C) 2011 osgPango Development Team
// $Id$

#ifndef OSGPANGO_GLYPHLAYERINTERFACE
#define OSGPANGO_GLYPHLAYERINTERFACE

#include <osgCairo/Image>
#include <osgPango/Export>

namespace osgPango {

//! This interface class provides X and Y offset members, in addition to methods by
//! which a user can manipulate these members. It can only be constructed by subclasses.
class OSGPANGO_EXPORT GlyphLayerInterfaceOffset {
public:
	int getOffsetX() const {
		return _xOffset; 
	}

	int getOffsetY() const {
		return _yOffset; 
	}

	void setOffsetX(int offset) {
		_xOffset = offset;
	}
	
	void setOffsetY(int offset) {
		_yOffset = offset; 
	}
	
protected:
	GlyphLayerInterfaceOffset(int offsetX, int offsetY);

	int _xOffset;
	int _yOffset;
};

//! This interface provides a blurring API to the subclass. 
class OSGPANGO_EXPORT GlyphLayerInterfaceBlur {
public:
	//! This powerful convenience routine handles the actual "blurring" of this interface
	//! class. It accepts a target format, a pattern (which is almost always the result
	//! or your desired surface having cairo_pop_group() called on it), and the width and
	//! height of the pattern. The returned result is a gaussian blurred copy of the
	//! passed-in pattern.
	cairo_surface_t* createBlurredSurface(
		cairo_format_t   format,
		cairo_pattern_t* pattern,
		unsigned int     width,
		unsigned int     height
	);

	double getRadius() const {
		return _radius; 
	}
	
	double getDeviation() const {
		return _deviation;
	}

	void setRadius(double radius) {
		_radius = radius; 
	}
	
	void setDeviation(double deviation) { 
		_deviation = deviation;
	}
	
protected:
	GlyphLayerInterfaceBlur(double, double);
	
	unsigned int _getBlurSize() const;
	
	double _radius;	
	double _deviation;
};

// TODO: Implement this!
class OSGPANGO_EXPORT GlyphLayerInterfaceEmboss {
public:
	cairo_surface_t* createEmbossedSurface(
		cairo_surface_t* surface,
		unsigned int     width,
		unsigned int     height
	);

	double getAzimuth() const {
		return _azimuth;
	}
	
	double getElevation() const {
		return _elevation;
	}

	void setAzimuth(double azimuth) {
		_azimuth = azimuth; 
	}
	
	void setElevation(double elevation) { 
		_elevation = elevation;
	}
	
protected:
	GlyphLayerInterfaceEmboss(double, double);
	
	double _azimuth;
	double _elevation;
};

}

#endif
